/* the struc demo
struct complex_struct {
	double x,y;
};
*/

/*
This is the final abbrevation of typedef struct
it means the same of :
struct complex_struct {...};
typedef struct complex_struct complex_struct;

*/
/*
typedef struct complex_struct {
	double x,y;
}complex_struct;
*/
#include"stdlib.h"

typedef struct linkedlist
{	
	struct linkedlist *next;
	int data;

	/* data */
}linkedlist;



void insertFront(linkedlist **head,int data){
	
	linkedlist *newlist=malloc(sizeof *newlist);
	newlist->data = data;
//	printf("The data inserted to newlist:%d\n",newlist->data);
	newlist->next = *head;  //next is a pointer should always point to a list address.
	*head = newlist;

}

/*
void insertFront2(linkedlist*& head,int data){
	
	linkedlist *newlist=malloc(sizeof *newlist);
	newlist->data = data;
	newlist->next = head;
	printf("before change The local head address:%d\n",head );
	head = newlist;
	printf("after The local head address:%d\n",head );

}
*/

linkedlist* Find(linkedlist *head,int item){
	printf("hello%d\n",item );
	printf("hello%d\n",head->next->data );
	while(head!=NULL && head->data != item){
		printf("This is not the right data!:%d\n", head->data);
		head = head->next;
	}

	return head;

}